#if !defined(AFX_SWCRIGHT_H__EEA90B60_2A1B_48C8_9575_3961E780EA53__INCLUDED_)
#define AFX_SWCRIGHT_H__EEA90B60_2A1B_48C8_9575_3961E780EA53__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SwcRight.h : header file
//
#include "JazzUpTellTaleButton.h"
#include "ResizableDialog.h"
#include "StackedWndCtrl.h"

/////////////////////////////////////////////////////////////////////////////
// CSwcRight form view

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif

class CSwcRight : public CFormView
{
protected:
	CSwcRight();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CSwcRight)

// Form Data
public:
	//{{AFX_DATA(CSwcRight)
	enum { IDD = IDD_DLG_RIGHT };
	CStackedWndCtrl	m_JazzedUpStackedWndCtrl;
	//}}AFX_DATA

// Attributes
public:

private:
	CResizableDialog	resizableDialog;
	BOOL				m_bShowGrip;
	CRect				m_rcGripRect;			// current pos of grip
// Operations
public:
	CStackedWndCtrl* GetStackedWnd();

private:
	void AddAnchor(HWND wnd, CSize tl_type, CSize br_type);
	void AddAnchor(UINT ctrl_ID, CSize tl_type,
		CSize br_type = NOANCHOR)	// add anchors to a control
	{
		AddAnchor(::GetDlgItem(*this, ctrl_ID), tl_type, br_type);
	};
	void ShowSizeGrip(BOOL bShow);

	class Layout
	{
	public:
		HWND hwnd;
		
		BOOL adj_hscroll;
		BOOL need_refresh;
		
		// upper-left corner
		CSize tl_type;
		CSize tl_margin;
		
		// bottom-right corner
		CSize br_type;
		CSize br_margin;
		
	public:
		Layout()
			: hwnd(NULL), adj_hscroll(FALSE), need_refresh(FALSE),
			tl_type(0,0), tl_margin(0,0),
			br_type(0,0), br_margin(0,0)
		{
		};
		
		Layout(HWND hw, SIZE tl_t, SIZE tl_m, 
			SIZE br_t, SIZE br_m, BOOL hscroll, BOOL refresh)
		{
			hwnd = hw;
			
			adj_hscroll = hscroll;
			need_refresh = refresh;
			
			tl_type = tl_t;
			tl_margin = tl_m;
			
			br_type = br_t;
			br_margin = br_m;
		};
	};

	CArray<Layout, Layout&> m_arrLayout;	// list of repositionable controls
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSwcRight)
	public:
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	virtual void OnInitialUpdate();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnDraw(CDC* pDC);
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CSwcRight();

	HICON	m_hIcon;
	CWnd*	ContentWnd	(int iIndex, CWnd* pParent);
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
	//{{AFX_MSG(CSwcRight)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SWCRIGHT_H__EEA90B60_2A1B_48C8_9575_3961E780EA53__INCLUDED_)
